unit editorApi;

interface

uses
  types,
  main,
  structs;

type
// CEditor
  CEditor = class( CMain )
  private { private }
    fSprite : structSprite;
// CEditor::exitAppFromESC
    function exitAppFromESC : bool;
  public { public }
// CEditor::go
    procedure go;
// basic function
// CEditor::doInit
    procedure doInit; override;
// CEditor::doFree
    procedure doFree; override;
// CEditor::doDraw
    procedure doDraw; override;
// CEditor::doUpdate
    procedure doUpdate; override;
// CEditor::doMessage
    procedure doMessage( var inMsg : structMsg ); override;
  end;

implementation

uses
  math,
  convertApi,
  msg,
  enums;
{ CEditor }

// CEditor::doDraw
procedure CEditor.doDraw;
begin
  inherited;
end;

// CEditor::doFree
procedure CEditor.doFree;
begin
  inherited;
end;

// CEditor::doInit
procedure CEditor.doInit;
begin
// create class convert api
  addChild( CConverter.Create );
// other
  fSprite.pos := _vec3( 0.0, 0.0, 0.0 );
  fSprite.size := _vec2( 100.0, 100.0 );
  inherited;
// test
  sendMsg( msgConvert, filesys.getFileHandle( 'mesh.exml' ), 0, 0 );
end;

// CEditor::doMessage
procedure CEditor.doMessage( var inMsg : structMsg );
begin
  inherited;
end;

// CEditor::doUpdate
procedure CEditor.doUpdate;
begin
  inherited;

end;

// CEditor::exitAppFromESC
function CEditor.exitAppFromESC : bool;
begin
  // todo: add exit in main proc
  appexit;
  result := true;
  // Assert(false);
end;

// CEditor::go
procedure CEditor.go;
begin
// load plugin(s)
  loaddil;
// init plugin(s)
  doInit;
// registry keu
  input.regCallBackKey( vkEscUp, exitAppFromESC );
// main run
  run;
end;

end.
